Skip to content

Conversation

@tannguyencse19
Copy link
Contributor

Summary

Updated the flow-merge logic so names that are present in all flows (even if only via attribute “narrows”) are treated as defined after a loop

fix #1378
fix #1397

Test Plan

cargo test -p pyrefly test_attribute_assignment_to_imported_singleton_in_method
cargo test -p pyrefly test_walrus_reuse_name_in_if_condition

@meta-cla meta-cla bot added the cla signed label Dec 26, 2025
@tannguyencse19 tannguyencse19 changed the title fix/issue-1378-1397-final fix: unbound-name after assignment to singleton attribute ; unexpected unbound-name error on second walrus conditional assignment for same variable Dec 26, 2025
// - It was defined before the loop (base_has_value), OR
// - It's defined in all loop body branches (since the loop definitely runs at least once)
// For regular loops and other merges, a name is always defined if it's in all branches.
let is_name_exists_in_all_branch_flow = match merge_style {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block of code was inserted between the comment above & the piece of code it describes below. I think it should be moved above the comment

The comment might also need to be updated since you made changes below

Copy link
Contributor Author

@tannguyencse19 tannguyencse19 Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed new commit: cdbed60


I moved the new logic so it sits directly under the comment it describes, and updated the comment to match the final behavior

@yangdanny97
Copy link
Contributor

This says #1397 is fixed, but I don't see the test cases for that. Do you mind adding the test case from the original issue as well as the one from the comment below?

let n_branch_flow_infos = flow_infos.len();
// Track if base has a value for this name (for LoopDefinitelyRuns init check)
let base_has_value = merge_item.base.as_ref().is_some_and(|b| b.value.is_some());
let base_has_name = merge_item.base.is_some();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we able to do this by modifying base_has_value? Perhaps instead of b.value.is_some() we should check taht b.value.is_some() || b.narrow.is_some() and if one of them is Some, its style shouldn't be FlowStyle::Uninitialized

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed new commit: cdbed60


Yes — I removed base_has_name and switched to a single base_has_binding = base.value.is_some() || base.narrow.is_some() so loop merges treat names that only have narrows as still present/defined.

Copy link
Contributor

@yangdanny97 yangdanny97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, back to you with some comments

I'm not 100% sure on the logic either, but see if you can get it to work without adding base_has_name. If we absolutely have to we can, but it might be simpler if we don't

@yangdanny97 yangdanny97 self-assigned this Dec 29, 2025
@tannguyencse19
Copy link
Contributor Author

@yangdanny97 Okay. I will try

@tannguyencse19
Copy link
Contributor Author

This says #1397 is fixed, but I don't see the test cases for that. Do you mind adding the test case from the original issue as well as the one from the comment below?

I pushed new commit: cdbed60


I added the testcase

@meta-codesync
Copy link

meta-codesync bot commented Jan 12, 2026

@yangdanny97 has imported this pull request. If you are a Meta employee, you can view this in D90510075.

@github-actions
Copy link

Diff from mypy_primer, showing the effect of this PR on open source code:

CPython (cases_generator) (https://github.com/python/cpython)
- ERROR Tools/cases_generator/parsing.py:589:36-38: `lx` may be uninitialized [unbound-name]
- ERROR Tools/cases_generator/parsing.py:634:22-24: `lx` may be uninitialized [unbound-name]
- ERROR Tools/cases_generator/parsing.py:634:33-35: `lx` may be uninitialized [unbound-name]
- ERROR Tools/cases_generator/parsing.py:634:70-72: `lx` may be uninitialized [unbound-name]
- ERROR Tools/cases_generator/tier2_generator.py:240:12-28: `name_offset_pair` may be uninitialized [unbound-name]
- ERROR Tools/cases_generator/tier2_generator.py:241:46-62: `name_offset_pair` may be uninitialized [unbound-name]

urllib3 (https://github.com/urllib3/urllib3)
- ERROR dummyserver/socketserver.py:167:25-33: Argument `Unknown | None` is not assignable to parameter `certfile` with type `PathLike[bytes] | PathLike[str] | bytes | str` in function `_ssl._SSLContext.load_cert_chain` [bad-argument-type]
- ERROR test/__init__.py:210:13-41: This `return` statement is unreachable [unreachable]
- ERROR test/test_connectionpool.py:53:21-39: `type[HTTPUnixConnection]` is not assignable to attribute `ConnectionCls` with type `type[BaseHTTPConnection] | type[BaseHTTPSConnection]` [bad-assignment]
+ ERROR test/with_dummyserver/test_https.py:1107:21-43: Object of class `DummyConnection` has no attribute `_connect_callback` [missing-attribute]
- ERROR src/urllib3/connection.py:170:9-13: Class member `HTTPConnection.host` overrides parent class `HTTPConnection` in an inconsistent manner [bad-override]
- ERROR src/urllib3/connectionpool.py:173:75-89: `type[HTTPConnection]` is not assignable to `type[BaseHTTPConnection] | type[BaseHTTPSConnection]` [bad-assignment]
- ERROR src/urllib3/connectionpool.py:892:16-24: `response` may be uninitialized [unbound-name]
- ERROR src/urllib3/connectionpool.py:900:67-75: `response` may be uninitialized [unbound-name]
- ERROR src/urllib3/connectionpool.py:903:21-29: `response` may be uninitialized [unbound-name]
- ERROR src/urllib3/connectionpool.py:905:24-32: `response` may be uninitialized [unbound-name]
- ERROR src/urllib3/connectionpool.py:907:13-21: `response` may be uninitialized [unbound-name]
- ERROR src/urllib3/connectionpool.py:908:37-45: `response` may be uninitialized [unbound-name]
- ERROR src/urllib3/connectionpool.py:929:32-40: `response` may be uninitialized [unbound-name]
- ERROR src/urllib3/connectionpool.py:930:37-45: `response` may be uninitialized [unbound-name]
- ERROR src/urllib3/connectionpool.py:932:67-75: `response` may be uninitialized [unbound-name]
- ERROR src/urllib3/connectionpool.py:935:21-29: `response` may be uninitialized [unbound-name]
- ERROR src/urllib3/connectionpool.py:937:24-32: `response` may be uninitialized [unbound-name]
- ERROR src/urllib3/connectionpool.py:939:13-21: `response` may be uninitialized [unbound-name]
- ERROR src/urllib3/connectionpool.py:940:27-35: `response` may be uninitialized [unbound-name]
- ERROR src/urllib3/connectionpool.py:960:16-24: `response` may be uninitialized [unbound-name]
- ERROR src/urllib3/contrib/socks.py:166:21-36: `type[SOCKSConnection]` is not assignable to attribute `ConnectionCls` with type `type[BaseHTTPConnection] | type[BaseHTTPSConnection]` [bad-assignment]
- ERROR src/urllib3/response.py:790:30-46: Argument `HTTPConnection` is not assignable to parameter `conn` with type `BaseHTTPConnection | None` in function `urllib3.connectionpool.HTTPConnectionPool._put_conn` [bad-argument-type]
- ERROR src/urllib3/response.py:820:9-19: Class member `HTTPResponse.connection` overrides parent class `BaseHTTPResponse` in an inconsistent manner [bad-override]
+ ERROR src/urllib3/util/ssl_.py:149:36-62: Expected a type form, got instance of `Literal['_TYPE_PEER_CERT_RET_DICT']` [not-a-type]
- ERROR src/urllib3/util/ssl_.py:368:43-76: No matching overload found for function `posixpath.expandvars` called with arguments: (str | None) [no-matching-overload]

cibuildwheel (https://github.com/pypa/cibuildwheel)
- ERROR cibuildwheel/platforms/ios.py:680:34-47: `final_command` may be uninitialized [unbound-name]
- ERROR cibuildwheel/platforms/ios.py:695:66-77: `built_wheel` may be uninitialized [unbound-name]
- ERROR cibuildwheel/platforms/ios.py:696:41-52: `built_wheel` may be uninitialized [unbound-name]
- ERROR cibuildwheel/platforms/ios.py:699:28-39: `built_wheel` may be uninitialized [unbound-name]
- ERROR cibuildwheel/platforms/pyodide.py:498:31-45: `repaired_wheel` may be uninitialized [unbound-name]
- ERROR cibuildwheel/platforms/pyodide.py:506:24-38: `repaired_wheel` may be uninitialized [unbound-name]
- ERROR cibuildwheel/platforms/pyodide.py:542:66-80: `repaired_wheel` may be uninitialized [unbound-name]
- ERROR cibuildwheel/platforms/pyodide.py:543:41-55: `repaired_wheel` may be uninitialized [unbound-name]
- ERROR cibuildwheel/platforms/pyodide.py:546:28-42: `repaired_wheel` may be uninitialized [unbound-name]

pwndbg (https://github.com/pwndbg/pwndbg)
- ERROR pwndbg/aglib/disasm/mips.py:246:21-28: `address` may be uninitialized [unbound-name]
- ERROR pwndbg/aglib/disasm/riscv.py:183:21-28: `address` may be uninitialized [unbound-name]
- ERROR pwndbg/aglib/disasm/riscv.py:197:21-28: `address` may be uninitialized [unbound-name]
- ERROR pwndbg/aglib/disasm/riscv.py:284:13-19: `target` may be uninitialized [unbound-name]
- ERROR pwndbg/aglib/disasm/x86.py:320:16-24: `seg_base` may be uninitialized [unbound-name]
- ERROR pwndbg/aglib/objc.py:1150:28-34: `pwndbg` may be uninitialized [unbound-name]
- ERROR pwndbg/aglib/objc.py:1152:16-22: `pwndbg` may be uninitialized [unbound-name]
- ERROR pwndbg/commands/cymbol.py:189:23-192:10: No matching overload found for function `subprocess.run` called with arguments: (list[Parameter | str], check=Literal[True]) [no-matching-overload]
- ERROR pwndbg/commands/ropper.py:54:29-32: Argument `list[str | None]` is not assignable to parameter `args` with type `PathLike[bytes] | PathLike[str] | Sequence[StrOrBytesPath] | bytes | str` in function `subprocess.call` [bad-argument-type]
- ERROR pwndbg/commands/telescope.py:274:5-14: `telescope` may be uninitialized [unbound-name]
- ERROR pwndbg/commands/telescope.py:275:5-14: `telescope` may be uninitialized [unbound-name]
- ERROR pwndbg/dbg_mod/lldb/repl/fuzzy.py:251:22-37: No matching overload found for function `open` called with arguments: (object) [no-matching-overload]
+ ERROR pwndbg/lib/memory.py:194:91-98: Argument `bytes | str` is not assignable to parameter `objfile` with type `str | None` in function `format_address` [bad-argument-type]

websockets (https://github.com/aaugustin/websockets)
- ERROR src/websockets/asyncio/connection.py:1243:51-61: `exceptions` may be uninitialized [unbound-name]
- ERROR src/websockets/legacy/protocol.py:1631:51-61: `exceptions` may be uninitialized [unbound-name]

meson (https://github.com/mesonbuild/meson)
- ERROR ci/ciimage/build.py:112:29-81: No matching overload found for function `subprocess.run` called with arguments: (list[str | None], cwd=Path, stdout=int) [no-matching-overload]
- ERROR ci/ciimage/build.py:124:26-31: No matching overload found for function `subprocess.run` called with arguments: (list[str | None]) [no-matching-overload]
- ERROR ci/ciimage/build.py:166:30-41: No matching overload found for function `subprocess.run` called with arguments: (list[str | None]) [no-matching-overload]
- ERROR ci/ciimage/build.py:188:30-40: No matching overload found for function `subprocess.run` called with arguments: (list[str | None]) [no-matching-overload]
- ERROR ci/ciimage/build.py:192:27-40: No matching overload found for function `subprocess.run` called with arguments: (list[str | None]) [no-matching-overload]
- ERROR ci/ciimage/build.py:214:27-36: No matching overload found for function `subprocess.run` called with arguments: (list[str | None]) [no-matching-overload]
- ERROR ci/ciimage/build.py:217:27-40: No matching overload found for function `subprocess.run` called with arguments: (list[str | None]) [no-matching-overload]
+ ERROR docs/extensions/refman_links.py:58:83-86: Argument `Literal['#']` is not assignable to parameter `sep` with type `Buffer | None` in function `bytes.split` [bad-argument-type]
- ERROR mesonbuild/backend/backends.py:321:32-77: No matching overload found for function `posixpath.join` called with arguments: (str, str | None) [no-matching-overload]
- ERROR mesonbuild/backend/backends.py:329:28-102: No matching overload found for function `posixpath.join` called with arguments: (Unknown, str | None) [no-matching-overload]
- ERROR mesonbuild/backend/backends.py:368:58-86: Argument `str | None` is not assignable to parameter `*args` with type `PathLike[str] | str` in function `pathlib.Path.__new__` [bad-argument-type]
+ ERROR mesonbuild/backend/backends.py:394:16-55: Returned type `bytes` is not assignable to declared return type `str` [bad-return]
+ ERROR mesonbuild/backend/backends.py:477:16-478:72: Returned type `bytes` is not assignable to declared return type `str` [bad-return]
+ ERROR mesonbuild/backend/backends.py:781:26-59: `+` is not supported between `Literal['meson-generated_']` and `bytes` [unsupported-operation]
+ ERROR mesonbuild/backend/backends.py:786:26-108: `+` is not supported between `Literal['meson-generated_']` and `bytes` [unsupported-operation]
+ ERROR mesonbuild/backend/backends.py:1290:16-23: Returned type `list[bytes] | list[str]` is not assignable to declared return type `list[str]` [bad-return]
- ERROR mesonbuild/backend/backends.py:1461:38-75: No matching overload found for function `posixpath.join` called with arguments: (Unknown, str | None) [no-matching-overload]
- ERROR mesonbuild/backend/backends.py:1774:54-102: No matching overload found for function `posixpath.join` called with arguments: (str, str | None) [no-matching-overload]
- ERROR mesonbuild/backend/ninjabackend.py:703:20-52: `captured_compile_args_per_target` may be uninitialized [unbound-name]
- ERROR mesonbuild/backend/ninjabackend.py:2805:39-89: No matching overload found for function `posixpath.join` called with arguments: (str, list[str]) [no-matching-overload]
- ERROR mesonbuild/backend/ninjabackend.py:4041:55-98: No matching overload found for function `posixpath.join` called with arguments: (str, Unknown | None) [no-matching-overload]
- ERROR mesonbuild/backend/vs2010backend.py:299:18-87: No matching overload found for function `open` called with arguments: (None, Literal['w'], encoding=Literal['utf-8']) [no-matching-overload]
- ERROR mesonbuild/backend/vs2010backend.py:560:33-79: Argument `tuple[str, PurePath, Unknown, MachineChoice]` is not assignable to parameter `object` with type `tuple[str, Path, str, MachineChoice]` in function `list.append` [bad-argument-type]
+ ERROR mesonbuild/backend/vs2010backend.py:865:16-22: Returned type `str | None` is not assignable to declared return type `str` [bad-return]
- ERROR mesonbuild/backend/vs2010backend.py:1480:36-86: No matching overload found for function `posixpath.join` called with arguments: (str, str | None) [no-matching-overload]
+ ERROR mesonbuild/backend/vs2010backend.py:1504:68-76: Argument `str` is not assignable to parameter `args` with type `list[str]` in function `mesonbuild.compilers.compilers.Compiler.get_link_whole_for` [bad-argument-type]
- ERROR mesonbuild/backend/vs2010backend.py:1745:21-37: `primary_src_lang` may be uninitialized [unbound-name]
+ ERROR mesonbuild/backend/vs2010backend.py:1677:73-85: Argument `Unknown | None` is not assignable to parameter `target_ext` with type `str` in function `Vs2010Backend.add_gen_lite_makefile_vcxproj_elements` [bad-argument-type]
- ERROR mesonbuild/backend/vs2010backend.py:1762:84-122: `defs_paths_opts_per_lang_and_buildtype` may be uninitialized [unbound-name]
- ERROR mesonbuild/backend/vs2010backend.py:1780:78-116: `defs_paths_opts_per_lang_and_buildtype` may be uninitialized [unbound-name]
- ERROR mesonbuild/backend/vs2010backend.py:1796:81-119: `defs_paths_opts_per_lang_and_buildtype` may be uninitialized [unbound-name]
- ERROR mesonbuild/backend/vs2010backend.py:1856:49-89: Argument `PureWindowsPath` is not assignable to parameter `todir` with type `str` in function `mesonbuild.backend.backends.Backend.relpath` [bad-argument-type]
- ERROR mesonbuild/backend/xcodebackend.py:416:25-424:49: `tuple[str, str] | tuple[str, ...]` is not assignable to `tuple[str, str]` (caused by inconsistent types when breaking cycles) [bad-assignment]
- ERROR mesonbuild/backend/xcodebackend.py:762:40-78: No matching overload found for function `posixpath.join` called with arguments: (Unknown, CustomTarget | CustomTargetIndex | GeneratedList | str) [no-matching-overload]
- ERROR mesonbuild/backend/xcodebackend.py:945:37-50: No matching overload found for function `posixpath.join` called with arguments: (str, CustomTarget | CustomTargetIndex | GeneratedList | str) [no-matching-overload]
- ERROR mesonbuild/build.py:2021:30-34: Argument `str | None` is not assignable to parameter `s` with type `PathLike[bytes] | PathLike[str] | bytes | str` in function `posixpath.isabs` [bad-argument-type]
- ERROR mesonbuild/build.py:2029:30-53: Argument `str | None` is not assignable to parameter `s` with type `PathLike[bytes] | PathLike[str] | bytes | str` in function `posixpath.isabs` [bad-argument-type]
- ERROR mesonbuild/build.py:2427:31-58: No matching overload found for function `posixpath.join` called with arguments: (str, Literal[False] | str, str) [no-matching-overload]
- ERROR mesonbuild/build.py:2781:34-38: Argument `str | None` is not assignable to parameter `s` with type `PathLike[bytes] | PathLike[str] | bytes | str` in function `posixpath.isabs` [bad-argument-type]
- ERROR mesonbuild/build.py:2992:31-48: No matching overload found for function `posixpath.splitext` called with arguments: (Program | str) [no-matching-overload]
- ERROR mesonbuild/cargo/interpreter.py:306:63-88: No matching overload found for function `posixpath.join` called with arguments: (str | None, str) [no-matching-overload]
- ERROR mesonbuild/cargo/interpreter.py:454:55-80: No matching overload found for function `posixpath.join` called with arguments: (str | None, str) [no-matching-overload]
+ ERROR mesonbuild/cargo/manifest.py:317:24-61: Returned type `bytes` is not assignable to declared return type `str | None` [bad-return]
- ERROR mesonbuild/compilers/mixins/clike.py:906:35-48: Argument `str | None` is not assignable to parameter `path` with type `PathLike[bytes] | PathLike[str] | bytes | int | str` in function `genericpath.isfile` [bad-argument-type]
- ERROR mesonbuild/compilers/mixins/clike.py:908:22-43: No matching overload found for function `open` called with arguments: (str | None, Literal['rb']) [no-matching-overload]
- ERROR mesonbuild/dependencies/cuda.py:56:30-44: Argument `str | None` is not assignable to parameter `s` with type `PathLike[bytes] | PathLike[str] | bytes | str` in function `posixpath.isabs` [bad-argument-type]
- ERROR mesonbuild/dependencies/cuda.py:65:39-84: No matching overload found for function `posixpath.join` called with arguments: (str | None, str, Literal['include']) [no-matching-overload]
- ERROR mesonbuild/dependencies/cuda.py:69:35-82: No matching overload found for function `posixpath.join` called with arguments: (str | None, str, str) [no-matching-overload]
- ERROR mesonbuild/dependencies/cuda.py:131:180-196: No matching overload found for function `posixpath.realpath` called with arguments: (str | None) [no-matching-overload]
- ERROR mesonbuild/dependencies/cuda.py:154:32-58: No matching overload found for function `posixpath.join` called with arguments: (str | None, str) [no-matching-overload]
- ERROR mesonbuild/dependencies/cuda.py:159:36-62: No matching overload found for function `posixpath.join` called with arguments: (str | None, str) [no-matching-overload]
- ERROR mesonbuild/dependencies/dev.py:591:43-77: Argument `str | None` is not assignable to parameter `*args` with type `PathLike[str] | str` in function `pathlib.Path.__new__` [bad-argument-type]
+ ERROR mesonbuild/dependencies/dev.py:613:29-55: `/` is not supported between `None` and `Literal['include']` [unsupported-operation]
+ ERROR mesonbuild/dependencies/dev.py:619:33-55: `/` is not supported between `None` and `Literal['lib']` [unsupported-operation]
+ ERROR mesonbuild/dependencies/dev.py:623:37-59: `/` is not supported between `None` and `Literal['jre']` [unsupported-operation]
+ ERROR mesonbuild/dependencies/dev.py:625:37-59: `/` is not supported between `None` and `Literal['lib']` [unsupported-operation]
- ERROR mesonbuild/dependencies/pkgconfig.py:379:23-27: `tmpl` may be uninitialized [unbound-name]
- ERROR mesonbuild/dependencies/pkgconfig.py:523:42-80: No matching overload found for function `posixpath.join` called with arguments: (str, str | None) [no-matching-overload]
- ERROR mesonbuild/dependencies/pkgconfig.py:525:46-93: No matching overload found for function `posixpath.join` called with arguments: (str, Literal['.libs'], str | None) [no-matching-overload]
- ERROR mesonbuild/dependencies/python.py:318:34-69: No matching overload found for function `posixpath.join` called with arguments: (str | None, Literal['bin']) [no-matching-overload]
- ERROR mesonbuild/dependencies/python.py:412:24-57: Argument `str | None` is not assignable to parameter `*args` with type `PathLike[str] | str` in function `pathlib.Path.__new__` [bad-argument-type]
- ERROR mesonbuild/dependencies/python.py:424:19-63: `/` is not supported between `Path` and `None` [unsupported-operation]
- ERROR mesonbuild/dependencies/python.py:424:24-52: Argument `str | None` is not assignable to parameter `*args` with type `PathLike[str] | str` in function `pathlib.Path.__new__` [bad-argument-type]
- ERROR mesonbuild/dependencies/qt.py:107:39-71: No matching overload found for function `posixpath.join` called with arguments: (str | None, Literal['Headers']) [no-matching-overload]
+ ERROR mesonbuild/interpreter/interpreter.py:551:38-39: Argument `File | str` is not assignable to parameter `value` with type `str` in function `mesonbuild.utils.universal.OrderedSet.add` [bad-argument-type]
- ERROR mesonbuild/interpreter/interpreter.py:2687:35-56: No matching overload found for function `posixpath.join` called with arguments: (str, Program | str) [no-matching-overload]
- ERROR mesonbuild/interpreter/interpreter.py:2700:63-98: No matching overload found for function `posixpath.join` called with arguments: (str, str, Program | str) [no-matching-overload]
- ERROR mesonbuild/interpreter/interpreter.py:2747:39-84: No matching overload found for function `posixpath.join` called with arguments: (str, Program | str) [no-matching-overload]
- ERROR mesonbuild/interpreter/interpreter.py:2765:56-63: Argument `Program | Unknown` is not assignable to parameter `text` with type `str` in function `mesonbuild.mlog.bold` [bad-argument-type]
+ ERROR mesonbuild/interpreter/interpreter.py:2765:56-63: Argument `Program | str` is not assignable to parameter `text` with type `str` in function `mesonbuild.mlog.bold` [bad-argument-type]
- ERROR mesonbuild/interpreter/interpreter.py:2766:26-53: No matching overload found for function `open` called with arguments: (Program | Unknown, encoding=Literal['utf-8']) [no-matching-overload]
+ ERROR mesonbuild/interpreter/interpreter.py:2814:56-59: Argument `list[bytes | str]` is not assignable to parameter `incdir_strings` with type `list[str]` in function `Interpreter.build_incdir_object` [bad-argument-type]
+ ERROR mesonbuild/linkers/linkers.py:618:16-94: Returned type `bytes` is not assignable to declared return type `str` [bad-return]
- ERROR mesonbuild/minstall.py:609:21-23: `os` may be uninitialized [unbound-name]
- ERROR mesonbuild/minstall.py:609:30-610:65: Unpacked argument `tuple[str, str, str | None, *tuple[str, ...], Literal['-C'], str, Literal['--no-rebuild']]` is not assignable to parameter `*args` with type `tuple[StrOrBytesPath, *tuple[StrOrBytesPath, ...]]` in function `os.execlp` [bad-argument-type]
- ERROR mesonbuild/minstall.py:610:37-39: `os` may be uninitialized [unbound-name]
+ ERROR mesonbuild/mintro.py:337:25-338:65: Argument `Generator[bytes, None, None]` is not assignable to parameter `iterable` with type `Iterable[str]` in function `list.extend` [bad-argument-type]
- ERROR mesonbuild/mintro.py:522:24-42: No matching overload found for function `posixpath.basename` called with arguments: (Any | None) [no-matching-overload]
+ ERROR mesonbuild/modules/_qt.py:351:76-92: Argument `bytes` is not assignable to parameter `fname` with type `str` in function `mesonbuild.utils.universal.File.__init__` [bad-argument-type]
- ERROR mesonbuild/modules/hotdoc.py:332:35-102: No matching overload found for function `posixpath.join` called with arguments: (bool | int | list[str] | str, bool | int | list[str] | str) [no-matching-overload]
+ ERROR mesonbuild/modules/hotdoc.py:265:16-79: Returned type `bytes` is not assignable to declared return type `str` [bad-return]
- ERROR mesonbuild/modules/pkgconfig.py:540:63-69: `srcdir` may be uninitialized [unbound-name]
- ERROR mesonbuild/msubprojects.py:531:29-56: Argument `str | None` is not assignable to parameter `*args` with type `PathLike[str] | str` in function `pathlib.Path.__new__` [bad-argument-type]
- ERROR mesonbuild/mtest.py:2206:16-19: `sys` may be uninitialized [unbound-name]
+ ERROR mesonbuild/mtest.py:2220:16-41: `bytes` is not assignable to variable `path` with type `str` [bad-assignment]
- ERROR mesonbuild/programs.py:201:30-61: Argument `str` is not assignable to parameter `object` with type `LiteralString` in function `list.append` [bad-argument-type]
- ERROR mesonbuild/rewriter.py:664:20-24: Returned type `None` is not assignable to declared return type `Path` [bad-return]
+ ERROR mesonbuild/rewriter.py:888:24-52: Returned type `bytes` is not assignable to declared return type `str` [bad-return]
- ERROR mesonbuild/scripts/clangformat.py:34:31-39: `original` may be uninitialized [unbound-name]
- ERROR mesonbuild/scripts/clangtidy.py:69:16-24: `applyret` may be uninitialized [unbound-name]
- ERROR mesonbuild/scripts/coverage.py:44:47-60: `gcovr_version` may be uninitialized [unbound-name]
- ERROR mesonbuild/scripts/coverage.py:58:51-64: `gcovr_version` may be uninitialized [unbound-name]
- ERROR mesonbuild/scripts/coverage.py:59:35-62:53: Argument `list[str | None] | list[str]` is not assignable to parameter `args` with type `PathLike[bytes] | PathLike[str] | Sequence[StrOrBytesPath] | bytes | str` in function `subprocess.check_call` [bad-argument-type]
- ERROR mesonbuild/scripts/coverage.py:69:51-64: `gcovr_version` may be uninitialized [unbound-name]
- ERROR mesonbuild/scripts/coverage.py:70:35-73:53: Argument `list[str | None] | list[str]` is not assignable to parameter `args` with type `PathLike[bytes] | PathLike[str] | Sequence[StrOrBytesPath] | bytes | str` in function `subprocess.check_call` [bad-argument-type]
- ERROR mesonbuild/scripts/coverage.py:80:51-64: `gcovr_version` may be uninitialized [unbound-name]
- ERROR mesonbuild/scripts/coverage.py:81:35-83:48: Argument `list[str | None] | list[str]` is not assignable to parameter `args` with type `PathLike[bytes] | PathLike[str] | Sequence[StrOrBytesPath] | bytes | str` in function `subprocess.check_call` [bad-argument-type]
- ERROR mesonbuild/scripts/coverage.py:158:53-66: `gcovr_version` may be uninitialized [unbound-name]

... (truncated 59 lines) ...

schema_salad (https://github.com/common-workflow-language/schema_salad)
- ERROR schema_salad/codegen.py:223:17-20: `gen` may be uninitialized [unbound-name]
+ ERROR schema_salad/metaschema.py:1153:25-32: `+` is not supported between `bytes` and `Literal['#']` [unsupported-operation]
+ ERROR schema_salad/metaschema.py:1153:25-52: `+` is not supported between `bytes` and `str` [unsupported-operation]
+ ERROR schema_salad/python_codegen_support.py:1150:25-32: `+` is not supported between `bytes` and `Literal['#']` [unsupported-operation]
+ ERROR schema_salad/python_codegen_support.py:1150:25-52: `+` is not supported between `bytes` and `str` [unsupported-operation]
+ ERROR schema_salad/sourceline.py:26:18-41: `bytes` is not assignable to variable `source` with type `str` [bad-assignment]
+ ERROR schema_salad/tests/test_print_oneline.py:113:16-32: `in` is not supported between `Literal['\\']` and `object` [not-iterable]
+ ERROR schema_salad/tests/test_print_oneline.py:114:34-48: Object of class `object` has no attribute `lower` [missing-attribute]

artigraph (https://github.com/artigraph/artigraph)
+ ERROR src/arti/internal/vendored/setuptools.py:92:44-55: Argument `LiteralString` is not assignable to parameter `old` with type `Buffer` in function `bytes.replace` [bad-argument-type]
+ ERROR src/arti/internal/vendored/setuptools.py:92:57-60: Argument `Literal['.']` is not assignable to parameter `new` with type `Buffer` in function `bytes.replace` [bad-argument-type]
+ ERROR src/arti/internal/vendored/setuptools.py:99:28-35: Argument `bytes` is not assignable to parameter with type `str` [bad-argument-type]
+ ERROR src/arti/internal/vendored/setuptools.py:99:53-60: Argument `bytes` is not assignable to parameter with type `str` [bad-argument-type]
+ ERROR src/arti/internal/vendored/setuptools.py:100:27-34: Type of yielded value `bytes` is not assignable to declared return type `str` [invalid-yield]

paroxython (https://github.com/laowantong/paroxython)
- ERROR paroxython/cli_recommend.py:136:22-30: `commands` may be uninitialized [unbound-name]
- ERROR paroxython/list_programs.py:51:55-59: Default `None` is not assignable to parameter `relative_path` with type `Path` [bad-function-definition]

cki-lib (https://gitlab.com/cki-project/cki-lib)
- ERROR cki_lib/certs.py:27:66-81: `not_valid_after` may be uninitialized [unbound-name]
- ERROR cki_lib/footer.py:52:29-79: Argument `Traversable` is not assignable to parameter `schema_path` with type `Path | str | None` in function `cki_lib.yaml.load` [bad-argument-type]
- ERROR cki_lib/inttests/cluster.py:162:12-18: `exists` may be uninitialized [unbound-name]
- ERROR cki_lib/inttests/rabbitmq.py:119:28-42: Argument `Path` is not assignable to parameter `verify` with type `bool | str | None` in function `requests.sessions.Session.put` [bad-argument-type]
- ERROR cki_lib/krb_ticket_refresher.py:63:23-64:35: No matching overload found for function `subprocess.run` called with arguments: (list[str | None], check=Literal[True]) [no-matching-overload]
- ERROR cki_lib/yaml.py:146:30-36: `schema` may be uninitialized [unbound-name]
- ERROR tests/kcidb/test_checks.py:370:42-56: Argument `Traversable` is not assignable to parameter `file_path` with type `Path | str | None` in function `cki_lib.yaml.load` [bad-argument-type]
- ERROR tests/kcidb/test_checks.py:421:42-56: Argument `Traversable` is not assignable to parameter `file_path` with type `Path | str | None` in function `cki_lib.yaml.load` [bad-argument-type]
- ERROR tests/kcidb/test_checks.py:460:42-56: Argument `Traversable` is not assignable to parameter `file_path` with type `Path | str | None` in function `cki_lib.yaml.load` [bad-argument-type]
- ERROR tests/kcidb/test_checks.py:511:42-99: Argument `Traversable` is not assignable to parameter `file_path` with type `Path | str | None` in function `cki_lib.yaml.load` [bad-argument-type]
- ERROR tests/test_yaml.py:64:46-83: Argument `Traversable` is not assignable to parameter `file_path` with type `Path | str | None` in function `cki_lib.yaml.load` [bad-argument-type]
- ERROR tests/test_yaml.py:76:41-78: Argument `Traversable` is not assignable to parameter `file_path` with type `Path | str | None` in function `cki_lib.yaml.load` [bad-argument-type]
- ERROR tests/test_yaml.py:77:43-75: Argument `Traversable` is not assignable to parameter `schema_path` with type `Path | str | None` in function `cki_lib.yaml.load` [bad-argument-type]
- ERROR tests/test_yaml.py:88:41-77: Argument `Traversable` is not assignable to parameter `file_path` with type `Path | str | None` in function `cki_lib.yaml.load` [bad-argument-type]
- ERROR tests/test_yaml.py:89:43-75: Argument `Traversable` is not assignable to parameter `schema_path` with type `Path | str | None` in function `cki_lib.yaml.load` [bad-argument-type]

build (https://github.com/pypa/build)
+ ERROR tests/test_env.py:80:30-32: Cannot instantiate `IsolatedEnv` because it is a protocol [bad-instantiation]
+ ERROR tests/test_env.py:88:19-21: Cannot instantiate `PartialEnv` because the following members are abstract: `python_executable`, `make_extra_environ` [bad-instantiation]
+ ERROR tests/test_env.py:95:19-21: Cannot instantiate `PartialEnv` because the following members are abstract: `python_executable` [bad-instantiation]
- ERROR tests/test_projectbuilder.py:513:9-53: Argument `Path` is not assignable to parameter `path` with type `SimplePath` in function `importlib_metadata.PathDistribution.__init__` [bad-argument-type]
- ERROR tests/test_projectbuilder.py:524:9-53: Argument `Path` is not assignable to parameter `path` with type `SimplePath` in function `importlib_metadata.PathDistribution.__init__` [bad-argument-type]
- ERROR tests/test_projectbuilder.py:536:9-53: Argument `Path` is not assignable to parameter `path` with type `SimplePath` in function `importlib_metadata.PathDistribution.__init__` [bad-argument-type]
- ERROR src/build/util.py:19:56-60: Argument `Path` is not assignable to parameter `path` with type `SimplePath` in function `importlib_metadata.PathDistribution.__init__` [bad-argument-type]

psycopg (https://github.com/psycopg/psycopg)
- ERROR psycopg/psycopg/_connection_base.py:257:12-18: `status` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/_connection_base.py:267:45-51: `status` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/_conninfo_attempts.py:62:8-22: `prefer_standby` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/_conninfo_attempts.py:103:15-19: `port` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/_conninfo_attempts_async.py:60:8-22: `prefer_standby` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/_conninfo_attempts_async.py:103:19-23: `port` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/_copy_base.py:94:27-33: `result` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/_copy_base.py:94:38-44: `result` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/_dns.py:147:16-24: `ports_in` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/_dns.py:151:64-72: `ports_in` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/_dns.py:156:41-49: `ports_in` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/_py_transformer.py:356:47-57: `loader_cls` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/connection.py:446:18-26: `pipeline` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/connection.py:447:23-31: `pipeline` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/connection.py:449:16-24: `pipeline` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/connection.py:451:28-36: `pipeline` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/connection_async.py:481:24-32: `pipeline` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/connection_async.py:482:23-31: `pipeline` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/connection_async.py:484:16-24: `pipeline` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/connection_async.py:486:28-36: `pipeline` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/dbapi20.py:77:45-49: `sobj` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/pq/_pq_ctypes.py:36:36-44: `libcname` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/pq/misc.py:174:25-31: `sparts` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/types/array.py:177:68-70: `ad` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/types/array.py:178:39-41: `ad` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/types/array.py:421:26-27: `t` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/types/composite.py:419:22-24: `ad` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/types/hstore.py:137:21-22: `v` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/types/json.py:122:12-15: `key` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/types/json.py:123:28-31: `key` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/types/json.py:142:12-15: `key` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/types/json.py:143:28-31: `key` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/types/json.py:192:45-49: `sobj` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/types/numeric.py:70:12-17: `value` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/types/numeric.py:71:34-39: `value` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/types/numeric.py:73:16-21: `value` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/types/numeric.py:73:46-51: `value` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/types/range.py:482:22-26: `item` may be uninitialized [unbound-name]
- ERROR psycopg/psycopg/waiting.py:450:12-18: `wait_c` may be uninitialized [unbound-name]
- ERROR psycopg_pool/psycopg_pool/pool.py:260:16-20: `conn` may be uninitialized [unbound-name]
- ERROR psycopg_pool/psycopg_pool/pool.py:273:9-13: `conn` may be uninitialized [unbound-name]
- ERROR psycopg_pool/psycopg_pool/pool.py:274:16-20: `conn` may be uninitialized [unbound-name]
- ERROR psycopg_pool/psycopg_pool/pool_async.py:297:16-20: `conn` may be uninitialized [unbound-name]
- ERROR psycopg_pool/psycopg_pool/pool_async.py:310:9-13: `conn` may be uninitialized [unbound-name]
- ERROR psycopg_pool/psycopg_pool/pool_async.py:311:16-20: `conn` may be uninitialized [unbound-name]
- ERROR psycopg_pool/psycopg_pool/sched.py:82:16-20: `task` may be uninitialized [unbound-name]
- ERROR psycopg_pool/psycopg_pool/sched.py:83:24-28: `task` may be uninitialized [unbound-name]
- ERROR psycopg_pool/psycopg_pool/sched.py:86:21-25: `task` may be uninitialized [unbound-name]
- ERROR psycopg_pool/psycopg_pool/sched.py:90:25-29: `task` may be uninitialized [unbound-name]
- ERROR psycopg_pool/psycopg_pool/sched_async.py:85:16-20: `task` may be uninitialized [unbound-name]
- ERROR psycopg_pool/psycopg_pool/sched_async.py:86:24-28: `task` may be uninitialized [unbound-name]
- ERROR psycopg_pool/psycopg_pool/sched_async.py:89:27-31: `task` may be uninitialized [unbound-name]
- ERROR psycopg_pool/psycopg_pool/sched_async.py:93:25-29: `task` may be uninitialized [unbound-name]
- ERROR tests/fix_crdb.py:47:12-15: `msg` may be uninitialized [unbound-name]
- ERROR tests/fix_db.py:299:18-25: `cmdcopy` may be uninitialized [unbound-name]
- ERROR tests/fix_faker.py:163:38-39: `r` may be uninitialized [unbound-name]
- ERROR tests/fix_faker.py:187:38-39: `r` may be uninitialized [unbound-name]
- ERROR tests/scripts/pipeline-demo.py:105:16-17: `r` may be uninitialized [unbound-name]
- ERROR tests/test_rows.py:155:8-15: `factory` may be uninitialized [unbound-name]
- ERROR tests/test_rows.py:156:19-26: `factory` may be uninitialized [unbound-name]
- ERROR tests/test_rows.py:157:8-15: `factory` may be uninitialized [unbound-name]
- ERROR tests/test_rows.py:158:19-26: `factory` may be uninitialized [unbound-name]
- ERROR tests/test_rows.py:160:12-19: `factory` may be uninitialized [unbound-name]

scikit-build-core (https://github.com/scikit-build/scikit-build-core)
- ERROR src/scikit_build_core/build/wheel.py:407:13-17: `path` may be uninitialized [unbound-name]
- ERROR src/scikit_build_core/build/wheel.py:408:13-17: `path` may be uninitialized [unbound-name]

egglog-python (https://github.com/egraphs-good/egglog-python)
- ERROR python/egglog/egraph.py:1208:21-28: `egraphs` may be uninitialized [unbound-name]

archinstall (https://github.com/archlinux/archinstall)
+ ERROR archinstall/lib/general.py:301:44-83: Argument `dict[bytes | str, bytes | str]` is not assignable to parameter `env` with type `Mapping[bytes, bytes | str] | Mapping[str, bytes | str]` in function `os.execve` [bad-argument-type]
- ERROR archinstall/lib/general.py:301:32-42: No matching overload found for function `list.__init__` called with arguments: (list[str]) [no-matching-overload]
- ERROR archinstall/lib/general.py:308:13-20: `old_dir` may be uninitialized [unbound-name]
- ERROR archinstall/lib/installer.py:198:10-29: `arch_config_handler` may be uninitialized [unbound-name]
- ERROR archinstall/lib/installer.py:213:10-29: `arch_config_handler` may be uninitialized [unbound-name]
+ ERROR archinstall/lib/plugins.py:55:49-58: Argument `str | None` is not assignable to parameter `name` with type `str` in function `_frozen_importlib_external.spec_from_file_location` [bad-argument-type]
+ ERROR archinstall/lib/plugins.py:58:16-25: Cannot set item in `dict[str, ModuleType]` [unsupported-operation]
+ ERROR archinstall/lib/plugins.py:59:40-49: Cannot index into `dict[str, ModuleType]` [bad-index]
+ ERROR archinstall/lib/plugins.py:61:10-19: Returned type `str | None` is not assignable to declared return type `str` [bad-return]
+ ERROR archinstall/lib/plugins.py:69:20-29: Cannot delete item in `dict[str, ModuleType]` [unsupported-operation]
+ ERROR archinstall/lib/plugins.py:73:9-18: Returned type `str | None` is not assignable to declared return type `str` [bad-return]

django-stubs (https://github.com/typeddjango/django-stubs)
- ERROR mypy_django_plugin/config.py:72:25-36: Argument `str | None` is not assignable to parameter `*args` with type `PathLike[str] | str` in function `pathlib.Path.__new__` [bad-argument-type]
- ERROR mypy_django_plugin/config.py:103:32-38: `config` may be uninitialized [unbound-name]
- ERROR mypy_django_plugin/config.py:106:44-50: `config` may be uninitialized [unbound-name]

cwltool (https://github.com/common-workflow-language/cwltool)
- ERROR cwltool/checker.py:64:39-47: `_srctype` may be uninitialized [unbound-name]
- ERROR cwltool/checker.py:66:39-47: `_srctype` may be uninitialized [unbound-name]
- ERROR cwltool/checker.py:71:37-45: `_srctype` may be uninitialized [unbound-name]
- ERROR cwltool/checker.py:79:46-54: `_srctype` may be uninitialized [unbound-name]
+ ERROR cwltool/command_line_tool.py:734:16-35: Object of class `MutableMapping` has no attribute `startswith`
+ Object of class `MutableSequence` has no attribute `startswith`
+ Object of class `NoneType` has no attribute `startswith`
+ Object of class `bool` has no attribute `startswith`
+ Object of class `float` has no attribute `startswith`
+ Object of class `int` has no attribute `startswith` [missing-attribute]
+ ERROR cwltool/command_line_tool.py:739:16-35: Object of class `MutableMapping` has no attribute `startswith`
+ Object of class `MutableSequence` has no attribute `startswith`
+ Object of class `NoneType` has no attribute `startswith`
+ Object of class `bool` has no attribute `startswith`
+ Object of class `float` has no attribute `startswith`
+ Object of class `int` has no attribute `startswith` [missing-attribute]
+ ERROR cwltool/cwlprov/ro.py:259:31-65: Argument `bytes` is not assignable to parameter `local_path` with type `str` in function `cwltool.utils.posix_path` [bad-argument-type]
+ ERROR cwltool/cwlprov/ro.py:558:31-65: Argument `bytes` is not assignable to parameter `local_path` with type `str` in function `cwltool.utils.posix_path` [bad-argument-type]
+ ERROR cwltool/cwlprov/writablebagfile.py:227:34-41: `str | None` is not assignable to attribute `folder` with type `str` [bad-assignment]
- ERROR cwltool/job.py:708:38-46: `new_file` may be uninitialized [unbound-name]
- ERROR cwltool/job.py:711:41-49: `new_file` may be uninitialized [unbound-name]
- ERROR cwltool/job.py:713:48-56: `new_file` may be uninitialized [unbound-name]
- ERROR cwltool/job.py:715:52-60: `new_file` may be uninitialized [unbound-name]
- ERROR cwltool/job.py:716:35-43: `new_file` may be uninitialized [unbound-name]
+ ERROR cwltool/main.py:541:31-57: Cannot set item in `MutableMapping[str, MutableMapping[str, Unknown] | MutableSequence[Unknown] | bool | float | int | str | None]` [unsupported-operation]
- ERROR cwltool/main.py:374:45-58: `input_basedir` may be uninitialized [unbound-name]
- ERROR cwltool/main.py:391:31-44: `input_basedir` may be uninitialized [unbound-name]
- ERROR cwltool/main.py:1317:17-21: `tool` may be uninitialized [unbound-name]
+ ERROR setup.py:49:19-60: Argument `list[bytes]` is not assignable to parameter `iterable` with type `Iterable[str]` in function `list.extend` [bad-argument-type]
- ERROR tests/test_provenance.py:438:22-24: `os` may be uninitialized [unbound-name]
- ERROR tests/test_provenance.py:439:16-18: `os` may be uninitialized [unbound-name]
- ERROR tests/test_udocker.py:56:24-26: `os` may be uninitialized [unbound-name]

kornia (https://github.com/kornia/kornia)
- ERROR kornia/augmentation/container/augment.py:482:16-28: `invalid_data` may be uninitialized [unbound-name]
- ERROR kornia/augmentation/container/augment.py:483:31-43: `invalid_data` may be uninitialized [unbound-name]
- ERROR kornia/augmentation/container/augment.py:532:44-57: `original_keys` may be uninitialized [unbound-name]
- ERROR kornia/augmentation/container/augment.py:532:80-93: `original_keys` may be uninitialized [unbound-name]
- ERROR kornia/augmentation/container/augment.py:536:40-53: `original_keys` may be uninitialized [unbound-name]
- ERROR kornia/augmentation/container/augment.py:536:76-89: `original_keys` may be uninitialized [unbound-name]
- ERROR kornia/contrib/visual_prompter.py:250:31-37: `points` may be uninitialized [unbound-name]
- ERROR kornia/feature/lightglue.py:673:24-28: `ind0` may be uninitialized [unbound-name]
- ERROR kornia/feature/lightglue.py:676:17-23: `prune0` may be uninitialized [unbound-name]
- ERROR kornia/feature/lightglue.py:681:24-28: `ind1` may be uninitialized [unbound-name]
- ERROR kornia/feature/lightglue.py:684:17-23: `prune1` may be uninitialized [unbound-name]

trio (https://github.com/python-trio/trio)
- ERROR src/trio/_core/_io_kqueue.py:24:32-45: No attribute `kevent` in module `select` [missing-attribute]
+ ERROR src/trio/_core/_io_epoll.py:31:26-49: Expected `EventResult` to be a type alias, got `Literal['list[tuple[int, int]]']` [invalid-type-alias]
+ ERROR src/trio/_core/_io_epoll.py:38:23-28: Invalid type inside literal, `Unknown` [invalid-literal]
+ ERROR src/trio/_core/_io_epoll.py:38:23-28: Could not find name `epoll` [unknown-name]
+ ERROR src/trio/_core/_io_kqueue.py:24:26-47: Expected `EventResult` to be a type alias, got `Literal['list[select.kevent]']` [invalid-type-alias]
+ ERROR src/trio/_core/_io_kqueue.py:31:23-29: Invalid type inside literal, `Unknown` [invalid-literal]
+ ERROR src/trio/_core/_io_kqueue.py:31:23-29: Could not find name `kqueue` [unknown-name]
+ ERROR src/trio/_core/_io_kqueue.py:285:34-42: Argument `Task | UnboundedQueue[Unknown]` is not assignable to parameter `task` with type `Task` in function `trio._core._generated_run.reschedule` [bad-argument-type]
+ ERROR src/trio/_core/_io_windows.py:300:23-30: Invalid type inside literal, `Unknown` [invalid-literal]
+ ERROR src/trio/_core/_io_windows.py:300:23-30: Could not find name `windows` [unknown-name]
+ ERROR src/trio/_core/_io_windows.py:322:16-27: Object of class `Handle` has no attribute `fileno`
+ Object of class `int` has no attribute `fileno` [missing-attribute]
+ ERROR src/trio/_core/_io_windows.py:367:24-35: Object of class `Handle` has no attribute `fileno`
+ Object of class `int` has no attribute `fileno` [missing-attribute]
+ ERROR src/trio/_core/_io_windows.py:698:29-73: First argument to `typing.cast` must be a type [bad-argument-type]
+ ERROR src/trio/_core/_io_windows.py:904:33-62: First argument to `typing.cast` must be a type [bad-argument-type]
+ ERROR src/trio/_core/_io_windows.py:935:28-68: First argument to `typing.cast` must be a type [bad-argument-type]
+ ERROR src/trio/_core/_io_windows.py:941:48-71: First argument to `typing.cast` must be a type [bad-argument-type]
- ERROR src/trio/_core/_run.py:2806:38-45: `cushion` may be uninitialized [unbound-name]
+ ERROR src/trio/_core/_tests/test_io.py:348:20-36: Object of class `_EpollStatistics` has no attribute `monitors` [missing-attribute]
+ ERROR src/trio/_core/_tests/test_io.py:349:20-41: Object of class `_EpollStatistics` has no attribute `tasks_waiting` [missing-attribute]
+ ERROR src/trio/_core/_tests/test_io.py:399:16-32: Object of class `_EpollStatistics` has no attribute `monitors` [missing-attribute]
+ ERROR src/trio/_core/_tests/test_io.py:400:16-37: Object of class `_EpollStatistics` has no attribute `tasks_waiting` [missing-attribute]
+ ERROR src/trio/_core/_tests/test_windows.py:263:20-31: Object of class `_CDataBase` has no attribute `fileno`
+ Object of class `int` has no attribute `fileno` [missing-attribute]
+ ERROR src/trio/_core/_tests/test_windows.py:294:20-31: Object of class `_CDataBase` has no attribute `fileno`
+ Object of class `int` has no attribute `fileno` [missing-attribute]
- ERROR src/trio/_path.py:267:36-40: Argument `Self@trio._path.Path` is not assignable to parameter `self` with type `pathlib.Path` in function `pathlib.PurePath.as_uri` [bad-argument-type]
+ ERROR src/trio/_path.py:280:5-17: Class member `PosixPath._wrapped_cls` overrides parent class `Path` in an inconsistent manner [bad-override]
+ ERROR src/trio/_path.py:289:5-17: Class member `WindowsPath._wrapped_cls` overrides parent class `Path` in an inconsistent manner [bad-override]
- ERROR src/trio/_tests/test_path.py:208:51-54: Argument `Literal[b'']` is not assignable to parameter with type `Path` [bad-argument-type]
- ERROR src/trio/_tests/test_path.py:209:42-45: Argument `Literal[b'']` is not assignable to parameter with type `Path` [bad-argument-type]
- ERROR src/trio/_tests/test_path.py:210:42-45: Argument `Literal[b'']` is not assignable to parameter with type `Path` [bad-argument-type]
- ERROR src/trio/_tests/test_path.py:218:37-46: `str` is not assignable to upper bound `Path` of type variable `PathT` [bad-specialization]
- ERROR src/trio/_tests/test_path.py:226:34-43: `str` is not assignable to upper bound `Path` of type variable `PathT` [bad-specialization]
- ERROR src/trio/_tests/test_path.py:243:42-45: Argument `Literal[b'']` is not assignable to parameter with type `Path` [bad-argument-type]
- ERROR src/trio/_tests/test_repl.py:345:16-19: `sys` may be uninitialized [unbound-name]
- ERROR src/trio/_tests/test_repl.py:374:16-19: `sys` may be uninitialized [unbound-name]
- ERROR src/trio/_tests/test_subprocess.py:680:31-57: Unpacked argument `tuple[list[str]]` is not assignable to parameter `*args` with type `tuple[StrOrBytesPath]` in function `trio._core._run.Nursery.start_soon` [bad-argument-type]
- ERROR src/trio/_tests/test_subprocess.py:680:32-43: Argument `Overload[(command: StrOrBytesPath, *, stdin: HasFileno | bytearray | bytes | int | memoryview[int] | None = b'', shell: Literal[True], **kwargs: Unpack[UnixRunProcessArgs]) -> Coroutine[Unknown, Unknown, CompletedProcess[bytes]], (command: Sequence[StrOrBytesPath], *, stdin: HasFileno | bytearray | bytes | int | memoryview[int] | None = b'', shell: bool = False, **kwargs: Unpack[UnixRunProcessArgs]) -> Coroutine[Unknown, Unknown, CompletedProcess[bytes]]]` is not assignable to parameter `async_fn` with type `(**tuple[StrOrBytesPath]) -> Awaitable[object]` in function `trio._core._run.Nursery.start_soon` [bad-argument-type]
- ERROR src/trio/_tests/test_subprocess.py:694:31-57: Unpacked argument `tuple[list[str]]` is not assignable to parameter `*args` with type `tuple[StrOrBytesPath]` in function `trio._core._run.Nursery.start_soon` [bad-argument-type]
- ERROR src/trio/_tests/test_subprocess.py:694:32-43: Argument `Overload[(command: StrOrBytesPath, *, stdin: HasFileno | bytearray | bytes | int | memoryview[int] | None = b'', shell: Literal[True], **kwargs: Unpack[UnixRunProcessArgs]) -> Coroutine[Unknown, Unknown, CompletedProcess[bytes]], (command: Sequence[StrOrBytesPath], *, stdin: HasFileno | bytearray | bytes | int | memoryview[int] | None = b'', shell: bool = False, **kwargs: Unpack[UnixRunProcessArgs]) -> Coroutine[Unknown, Unknown, CompletedProcess[bytes]]]` is not assignable to parameter `async_fn` with type `(**tuple[StrOrBytesPath]) -> Awaitable[object]` in function `trio._core._run.Nursery.start_soon` [bad-argument-type]
- ERROR src/trio/_tests/type_tests/path.py:67:34-39: Argument `Literal[511]` is not assignable to parameter with type `Path` [bad-argument-type]
- ERROR src/trio/_tests/type_tests/path.py:70:34-42: `str` is not assignable to upper bound `Path` of type variable `PathT` [bad-specialization]
- ERROR src/trio/_tests/type_tests/path.py:88:35-40: Argument `Literal[73]` is not assignable to parameter with type `Path` [bad-argument-type]
- ERROR src/trio/_tests/type_tests/path.py:97:34-45: `str` is not assignable to upper bound `Path` of type variable `PathT` [bad-specialization]
- ERROR src/trio/_tests/type_tests/path.py:100:38-46: `str` is not assignable to upper bound `Path` of type variable `PathT` [bad-specialization]
- ERROR src/trio/_tests/type_tests/path.py:102:40-48: `str` is not assignable to upper bound `Path` of type variable `PathT` [bad-specialization]
- ERROR src/trio/_tests/type_tests/path.py:105:37-53: Argument `Literal['something_else']` is not assignable to parameter with type `Path` [bad-argument-type]
- ERROR src/trio/_tests/type_tests/path.py:106:39-50: Argument `Literal['somewhere']` is not assignable to parameter with type `Path` [bad-argument-type]
- ERROR src/trio/_tests/type_tests/path.py:107:40-51: Argument `Literal['elsewhere']` is not assignable to parameter with type `Path` [bad-argument-type]

... (truncated 1721 lines) ...```

Copy link
Contributor

@yangdanny97 yangdanny97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the mypy primer output, it sounds like we're getting rid of a bunch of may be uninitialized errors (good) but adding a lot of other errors (bad/not expected).

Could you please look into what's happening here? I don't see why we would be getting these new errors

@yangdanny97
Copy link
Contributor

This issue is likely related: #2027

_ => n_values == n_branches,
MergeStyle::Loop => base_has_binding && is_name_exists_in_all_branch_flow,
MergeStyle::LoopDefinitelyRuns => base_has_binding || is_name_exists_in_all_branch_flow,
MergeStyle::BoolOp if has_uninitialized_style => false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this case is redundant with the one below

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yangdanny97 I fixed in my latest commit: 4659033

@yangdanny97
Copy link
Contributor

What are your thoughts on the new mypy primer errors? Also, i see there are merge conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unexpected unbound-name error on second walrus conditional assignment for same variable unbound-name after assignment to singleton attribute

2 participants